<!-- view my topics -->

<?php $this->load->view('include/header'); ?>

<?php 
	foreach ($rows as $r){
		if ($r){
			$flag = true;
		}
		else 
			$flag = false;
	}
		if ($flag){
			echo "<table border='1'>
			<tr>
			<th>TopicID</th>
			<th>Name</th>
			<th>Type</th>
			<th>Quantity</th>
			<th>Available</th>
			</tr>";
			foreach($rows as $r){
				echo "<tr>";
				echo '<td align="center">'.$r->thesis_id.'</td>';
				echo '<td align="center">'.anchor('thesis/viewtopic/'.$r->thesis_id,$r->name).'</td>';
				echo '<td align="center">'.$r->thesisType.'</td>';
				echo '<td align="center">'.'<p>'.$r->quantity_students.'</p>'.'</td>';
				echo '<td align="center">'.'<p>'.($r->quantity_students - $r->accepted).'</p>'.'</td>';
				echo "</tr>";
			}
			echo "</table>";	
		}else
			echo '<p>'."No topic is avaiable".'</p>';	
	
?>

<?php $this->load->view('include/footer'); ?>
